/*
 *  Copyright 2019-2020 Zheng Jie
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.fzhucc.modules.dawei.controller;

import com.fzhucc.annotation.Log;
import com.fzhucc.annotation.rest.AnonymousGetMapping;
import com.fzhucc.annotation.rest.AnonymousPostMapping;
import com.fzhucc.modules.dawei.service.DaweiService;
import com.fzhucc.modules.expert.domain.dto.*;
import com.fzhucc.modules.expert.service.ExpertService;
import com.fzhucc.modules.security.domain.dto.AuthDto;
import com.fzhucc.modules.security.security.TokenProvider;
import com.fzhucc.modules.security.service.AuthenticationService;
import com.fzhucc.modules.security.service.OnlineUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author yyg
 * @date 2023-11-07
 */
@RestController
@RequiredArgsConstructor
@Api(tags = "大为:接口关联")
@RequestMapping("/api/daWei")
public class DaweiController {


    private final DaweiService daweiService;

    @Log("获取token")
    @ApiOperation("获取token")
    @GetMapping(value = "/getTokenWithUrl")
    public ResponseEntity<Object> getTokenWithUrl() {
        return new ResponseEntity<>(daweiService.getTokenWithUrl(),HttpStatus.OK);
    }

    /*@Log("获取公私钥")
    @ApiOperation("获取公私钥")
    @AnonymousGetMapping(value = "/getKey")
    public ResponseEntity<Object> getKey() throws Exception{
        return new ResponseEntity<>(daweiService.getKey(),HttpStatus.OK);
    }*/
}